#include <stdio.h>
#include <iostream>
#include "FPSetup.h"
#include <cmath>

int main()
{
	//unsigned int cw0 = _controlfp(0,0);
	//printf("%.4x\n",cw0);
	//unsigned int cw1 = _controlfp(0,_MCW_EM);
	//printf("%.4x\n",cw1);
	enable_fp_exceptions();

	try{
		double x=0;
		double y=1e6;
		//double z=y/x; //1.#INF
		double z = exp(y);
		std::cout << z << std::endl;
	}
	catch (fe_divide_by_zero& e) {
		std::cout << e.what() << std::endl;
	}
	catch (float_exception& e) {
		std::cout << e.what() << std::endl;
	}
	catch (...) {
		std::cout << "Unknown C++ exception" << std::endl;
	}
}